import request from "@/utils/request"
import { remoteRequest } from '@/utils/remote.js'

const baseUrl = '/manage/map'

// 模板上传
export function uploadSave(data) {
  return request({
    url: `${baseUrl}/save`,
    method: "post",
    data
  })
}
// 列表
export function getAll(params) {
  return request({
    url: `${baseUrl}/getAll`,
    method: "get",
    params
  })
}

// 查看
export function getById(id) {
  return request({
    url: `${baseUrl}/getById/${id}`,
    method: "get"
  })
}

// 删除
export function deleteIds(ids) {
  return request({
    url: `${baseUrl}/delete/${ids}`,
    method: "post"
  })
}

// 修改
export function uploadUpdate(data) {
  return request({
    url: `${baseUrl}/update`,
    method: "post",
    data
  })
}

// 重复校验
export function checkName(data) {
  return remoteRequest('checkName', data, () => {
    return request({
      url: `${baseUrl}/checkName`,
      method: "post",
      data
    })
  })
}